package com.jiuzhou.guanwang.jzcp.adapter;

import android.content.Context;

import com.jiuzhou.guanwang.jzcp.R;
import com.jiuzhou.guanwang.jzcp.base.BaseRecyclerAdapter;
import com.jiuzhou.guanwang.jzcp.base.BaseRecyclerHolder;
import com.jiuzhou.guanwang.jzcp.bean.HomeCPBean;

import java.util.List;

/**
 * @ explain:
 * @ author：xujun on 2016/10/18 16:42
 * @ email：gdutxiaoxu@163.com
 */
public class HomeSpecialityAdapter extends BaseRecyclerAdapter<HomeCPBean> {

    public HomeSpecialityAdapter(Context context, List<HomeCPBean> datas) {
        super(context, R.layout.home_speciality_item, datas);
    }

    @Override
    public void convert(BaseRecyclerHolder holder, HomeCPBean item, int position) {
        holder.setText(R.id.tv_title, item.getName());
        int iconId = R.drawable.ic_more;
        String  desc = "";
        switch (item.getCode()) {
            case "dlt":
                iconId =R.drawable.ic_dlt2;
                desc = "乐在其中";
                break;
            case "ssq":
                iconId =R.drawable.ic_ssq2;
                desc = "2元中1000万";
                break;
            case "qlc":
                iconId =R.drawable.ic_qlc2;
                desc = "2元中500万";
                break;
            case "qxc":
                iconId =R.drawable.ic_qxc2;
                desc = "奖金最高500万";
                break;
        }
        holder.setImageResource(R.id.cp_icon, iconId);
        holder.setText(R.id.tv_desc,desc);

    }
}
